import {getTagDetailByIdApi, getUserTagListApi, getUserTagTaskStatusApi} from "@/api/userTag";


const userTagManage = {
	namespaced: true,
	state: {},
	mutations: {
	},
	getters:{},
	actions: {
		getUserTagList (context) {
			return new Promise((resolve, reject) => {
				getUserTagListApi()
					.then(res => {
						if (res.code === 0) {
							resolve(res.data)
						} else {
							reject(res)
						}
					}).catch(error => {
					console.error(error)
					reject(error)
				})
			})
		},
		getUserTagTaskStatusList(){
			return new Promise((resolve, reject) => {
				getUserTagTaskStatusApi()
					.then(res => {
						if (res.code === 0) {
							resolve(res.data)
						} else {
							reject(res)
						}
					}).catch(error => {
					console.error(error)
					reject(error)
				})
			})
		},
		getTagDetailById(context,params){
			return new Promise((resolve, reject) => {
				getTagDetailByIdApi(params)
					.then(res => {
						if (res.code === 0) {
							resolve(res.data)
						} else {
							reject(res)
						}
					}).catch(error => {
					console.error(error)
					reject(error)
				})
			})
		}

	},
}

export default userTagManage
